package com.cwj;

/**
 * @author chenwujie
 * @date 2020/11/0615:41
 */
public class BitTest {
    public static void main(String[] args) {
        System.out.println(Integer.toBinaryString(-1));
        System.out.println(Integer.toBinaryString(0b1000_0000_0000_0000_0000_0000_0000_0000 >> 2));
        System.out.println(Integer.toBinaryString(0b10000000000000000000000000000000 >> 2));
        System.out.println(0123);
        boolean b1 = false;
        boolean b2 = false;
//        int b3 = b1 ^ b2; // 编译错误 b1 ^ b2的结果是boolean类型
        System.out.println(b1 ^ b2);
        System.out.println(!b1);

        System.out.println(Integer.toBinaryString(-3));
        System.out.println(Integer.toBinaryString(~-3));
        System.out.println(Integer.toBinaryString(3));
        System.out.println(Integer.toBinaryString(~3));
   }
}
